package com.cat.bitOperation;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/neighboring-bitwise-xor/
 * @create 2025/8/20 09:47
 * @since JDK17
 */

public class Solution03 {
    public boolean doesValidArrayExist(int[] derived) {
        int n = derived.length, xor = 0;
        for (int i = 0; i < n; i++) {
            xor ^= derived[i];
        }

        return xor == 0;
    }
}
